#include <stdio.h>
int Calculate()
{
    int n0, n1, n2;
    char op0, op1, op2;
    n0 = 0, op0 = '+';
    while (op0 != '=')
    {
        scanf("%d %c", &n1, &op1);
        while (op1 == '*' || op1 == '/')
        {
            scanf("%d %c", &n2, &op2);
            if (op1 == '*')
                n1 *= n2;
            else if (op1 == '/')
                n1 /= n2;
            op1 = op2;
        }
        if (op0 == '+')
            n0 += n1;
        else if (op0 == '-')
            n0 -= n1;
        op0 = op1;
    }
    return n0;
}

int main()
{
    int ans = Calculate();
    printf("%d\n", ans);
    return 0;
}